package com.xiaobai.netease_news.model;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/6/25 0025.
 */
public class Mp3Data {
    private String template;
    private String docid;
    private String title;
    private String tid;
    private String source;
    private int replayCount;
    private List<VideoData> videoList;
    public void parseJSON(JSONObject jsonObject,String id) {
        JSONObject json = jsonObject.optJSONObject(id);
        replayCount = json.optInt("replayCount");
        template = json.optString("template");
        docid = json.optString("docid");
        title = json.optString("title");
        tid = json.optString("tid");
        source = json.optString("source");
        videoList = new ArrayList<VideoData>();
        JSONArray videos = json.optJSONArray("video");
        if (videos != null) {
            for (int i = 0; i < videos.length(); i++) {
                JSONObject jsonObject2 = videos.optJSONObject(i);
                VideoData videoData = new VideoData();
                videoData.parseJSON(jsonObject2);
                videoList.add(videoData);
            }
        }
    }

    public int getReplayCount() {
        return replayCount;
    }

    public String getTemplate() {
        return template;
    }

    public String getDocid() {
        return docid;
    }

    public String getTitle() {
        return title;
    }

    public String getTid() {
        return tid;
    }

    public String getSource() {
        return source;
    }

    public List<VideoData> getVideoList() {
        return videoList;
    }
}
